package com.ccp.dev.workflow.model.bpm;

/**
 * ClassDescribe:
 * @author :jiayueqiao
 * Date: 2019-07-11
 * Since:1
 */
public class PreViewModel{
    /**
     * 发起人
     */
    public final static int START_USER=1;
    /**
     * 上个任务执行人
     */
    public final static int PRE_VIEW_USER=2;
    /**
     * 表单用户变量
     */
    public final static int FORM_USER=3;
    /**
     * 表单组织变量
     */
    public final static int FORM_ORG=4;
    /**
     * 表单职务变量
     */
    public final static int FORM_JOB=5;
    /**
     * 表单岗位变量
     */
    public final static int FORM_POS=6;
    /**
     * 表单角色变量
     */
    public final static int FORM_ROLE=7;
    /**
     * 发起人的组织
     */
    public final static int START_ORG=8;
    /**
     * 上一个执行人的部门
     */
    public final static int PRE_ORG=9;
    /**
     *发起人的岗位
     */
    public final static int START_POS=10;
    /**
     * 发起人的职务
     */
    public final static int START_JOB=11;
    /**
     * 预览标题
     */
    private String title="";
    /**
     * 类型
     */
    private int type=0;
    /**
     * 预览标题
     * @return
     */
    public String getTitle() {
        switch (this.type) {
            case START_USER:
                title ="发起人";
                break;
            case PRE_VIEW_USER:
                title = "上个任务执行人";
                break;
            case FORM_USER:
                title = "表单用户变量";
                break;
            case FORM_ORG:
                title = "表单组织变量";
                break;
            case FORM_POS:
                title = "表单岗位变量";
                break;
            case FORM_JOB:
                title = "表单职务变量";
                break;
            case FORM_ROLE:
                title = "表单岗位变量";
                break;
            case START_ORG:
                title = "发起人的组织";
                break;
            case START_POS:
                title = "发起人的岗位";
                break;
            case START_JOB:
                title = "发起人的职务";
                break;
            case PRE_ORG:
                title = "上一个执行人的部门";
                break;
            default:
                break;
        }
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + type;
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj){
            return true;
        }
        if (obj == null){
            return false;
        }
        if (getClass() != obj.getClass()){
            return false;
        }
        PreViewModel other = (PreViewModel) obj;
        if (type != other.type){
            return false;
        }
        return true;
    }


}
